<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$this->model('member')->checklogin();
$this->model('model')->checkbang();
if($_RQ['op']=='main'){
	$setting=$return['pluginset'];
	$sharelink='jy_jianghu/index//fromuser='.$_SESSION['uid'];
	set_html('title','我的江湖');
	exi($return);
}
if($_RQ['op']=='getlist'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 11;
	$params=array('uniacid'=>$_SESSION['uniacid']);
	$myjias=pdo_getall('jy_jianghu_myjia',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),'jianghu_id','jianghu_id');
    if(count($myjias)){
		$myjias=array_keys($myjias);
		$params['id']=$myjias;
	}
	$orderby='zhanli desc, createtime desc';
	$total='';
	$return['list']=pdo_getslice('jy_jianghu_bangpai',$params,array($pindex,$psize),$total,$fields,'',$orderby);	
	foreach($return['list'] as $k=>&$v){
			$v['createtime']=date('Y-m-d H:m:s',$v['createtime']);
			$v['typetitle']=$this->fen_type[$v['type']];
			$v['statustitle']=$this->commission_status[$v['status']];
			$v['member']=cfc('core')->member_show($v['ordermid']);
			$v['image']=$v['image']?:$v['member']['avatar'];
			$v['bangtitle']=$this->bangpais[$k];
			$v['all_num']=pdo_count('jy_jianghu_myjia',array('jianghu_id'=>$v['id']),'mid');
	}
	exi($return);
}